<template>
  <el-row type="flex" justify="end" class="paginate" v-if="page.totalCount > page.currentCount">
    <el-pagination
      @current-change="callback"
      :page-size="page.currentCount || 20"
      :current-page="page.currentPage || 1"
      layout="prev, pager, next, jumper, total"
      :total="page.totalCount">
    </el-pagination>
  </el-row>
</template>
<script>
export default {
  data () {
    return {
      // currentPage: 3
    }
  },
  props: {
    callback: {
      type: Function,
      required: true
    },
    page: {
      type: Object,
      default: function () {
        return {}
      },
      required: true
    }
  },
  methods: {
    handleCurrentChange (val) {
      this.callback(val)
    }
  }
}
</script>
<style scoped>
.paginate {
  margin-top: 10px;
}
</style>
